﻿package com.wxsoft.business.physic.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.wxsoft.business.model.easyui.PageHelper;
import com.wxsoft.util.wx.UUIDUtil;

import com.wxsoft.business.physic.dao.IPsPhysicInDetailDao;
import com.wxsoft.business.physic.service.IPsPhysicInDetailService;
import com.wxsoft.business.physic.pojo.PsPhysicInDetail;

@Service("psPhysicInDetailService")
public class PsPhysicInDetailServiceImpl implements IPsPhysicInDetailService  {
	@Resource
	private IPsPhysicInDetailDao dao;
	
	
	public long findCount(PsPhysicInDetail psPhysicInDetail) {
		return dao.findCount(psPhysicInDetail);
	}
	
	public List<PsPhysicInDetail> findAll(PageHelper page,PsPhysicInDetail psPhysicInDetail) {
        List<PsPhysicInDetail> r = dao.findAll(page,psPhysicInDetail);
		return r;
	}
	public List<PsPhysicInDetail> getByIONum(PsPhysicInDetail psPhysicInDetail) {
        List<PsPhysicInDetail> r = dao.getByIONum(psPhysicInDetail);
		return r;
	}
	@Transactional(readOnly = false, propagation = Propagation.REQUIRES_NEW)
	public String add(PsPhysicInDetail psPhysicInDetail) {
		psPhysicInDetail.setId(UUIDUtil.getUUID());
		int r = this.dao.insert(psPhysicInDetail);
		if(r==1){
			return "操作成功!";
		}
		return "操作失败!";
	}
	
	public String modify(PsPhysicInDetail psPhysicInDetail) {
		int r = this.dao.modify(psPhysicInDetail);
		if(r==1){
			return "操作成功!";
		}
		return "操作失败!";
	}
	
	public String delete(PsPhysicInDetail psPhysicInDetail) {
		int r = this.dao.delete(psPhysicInDetail);
		if(r==1){
			return "操作成功!";
		}
		return "操作失败!";
	}
	
}
